<?php
namespace App\Http\Controllers\Validator;
use Validator;

/**
 * Class ContractVali
 * @package App\Http\Controllers\Validator
 * 合同验证器
 */
class MoveRuleVali{

    public static function validate($params)
    {
        $return = true;
        $validator = Validator::make($params, [
            'a_d_id'      => 'required',
            'a_move_type' => 'required',
            'a_date_type' => 'required',
            'a_day_num' => 'required',
            'a_trade_type' => 'required',
            'a_m_status' => 'required',
            'a_use_type' => 'required',
            'a_entrust_way' => 'required'
        ]);
        if ($validator->fails()) {
            $return = false;
        }
        return $return;
    }

    /**
     * @param $params
     * @return bool
     * 员工转房客
     */
    public static function moveValidate($params)
    {
        $return = true;
        $validator = Validator::make($params, [
            'move_type'      => 'required', //转移类目
            'out_d_id' => 'required',      //转出人部门ID
            'out_uid' => 'required',      //转出人ID
            'to_d_id' => 'required',      //转入人部门ID
            'to_uid' => 'required',       //转入人ID
            'num'    => 'required'
            //后期可以考虑是否加入时间必填验证
        ]);
        if ($validator->fails()) {
            $return = false;
        }
        return $return;
    }

    /**
     * @param $params
     * @return bool
     * 员工 公私盘 公私客相互转换
     */
    public static function turnValidate($params)
    {
        $return = true;
        $validator = Validator::make($params, [
            'turn_type'      => 'required', //转移类目
            'a_date_type' => 'required',      //时间类型
            'a_day_num' => 'required',      //天数
        ]);
        if ($validator->fails()) {
            $return = false;
        }
        return $return;
    }


}